package com.yootk.main;

import com.yootk.bean.vo.bean.MessageChannel;
import com.yootk.config.CompanyConfig;
import com.yootk.config.EmpConfig;
import com.yootk.listener.Emp;
import com.yootk.vo.Dept;
import com.yootk.vo.ICompany;
import com.yootk.vo.Member;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Repository;

import java.lang.reflect.Array;
import java.util.Arrays;

public class BeanDelinitionDemo { // Spring容器的启动类
    private static final Logger LOGGER = LoggerFactory.getLogger(BeanDelinitionDemo.class);

    public static void main(String[] args) throws Exception {

        // 容器的启动需要使用到特定的接口和类，此时的配置文件保存在CLASSPATH路径下，所以直接使用此类实例化
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.scan("com.yootk.config","com.yootk.factory");
        context.refresh();
        MessageChannel channel = context.getBean(MessageChannel.class) ;
        LOGGER.info("【现在的消息是】host={},token={}",channel.getHost(),channel.getToken());

    }
}